const BaseHandler = require('../base-handler');
const SystemServices = require('../../../constants').SystemServices;
const HTTP_VERBS = require('../../../constants').HTTP_VERBS;

class ActiveHandler extends BaseHandler {
    get pattern() {
        return "/admin/to/active";
    }
    
    doGET(request, response) {
        if (request.session.user.authenticated) {
            return response.render('active', {
                user: request.session.user
            });
        } else {
            response.redirect('/login');
        }
    }

    setup() {
        this.registerVerb(HTTP_VERBS.GET, this.doGET);
    }
}

module.exports = ActiveHandler;
